<script type="text/javascript" src="/js/pages/userList.js"></script>
<th:block layout:include="fragments/ui :: main (title='用户列表')">
    <th:block layout:fragment="main-content">
        <th:block layout:include="fragments/ui :: box (title='搜索', iconClass='fa-search')">
            <th:block layout:fragment="box-content">
                <form class="form-horizontal">
                    <div class="box-body">
                        <div class="form-group">
                            <label for="name" class="col-sm-2 control-label">姓名</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" id="name" placeholder="请输入姓名" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="phone" class="col-sm-2 control-label">手机号</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" id="phone" placeholder="请输入手机号" />
                            </div>
                        </div>
                    </div>
                    <div class="box-footer">
                        <div class="col-sm-offset-2 col-sm-6">
                            <button type="button" class="btn btn-primary query_btn"><i class="fa fa-search"></i> 查询</button>
                        </div>
                    </div>
                </form>
            </th:block>
        </th:block>
        <th:block layout:include="fragments/ui :: box (title='用户列表', iconClass='fa-bars')">
            <th:block layout:fragment="box-content">
                <a type="button" class="btn btn-success add_btn"><i class="fa fa-plus"></i> 添加用户</a>
                <a type="button" class="btn btn-danger del_btn hide"><i class="fa fa-times"></i> 删除用户</a>
                <div th:include="fragments/ajax-table :: ajax-table (id=UserList, head=${ {'ID', '手机', '邮箱', '姓名', '状态'} }, ajaxurl='/user')"></div>
            </th:block>
        </th:block>
    </th:block>
</th:block>

<!-- add Modal -->
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="addModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">新建用户</h4>
            </div>
            <div class="modal-body">
                <form id="addUserForm" class="form-horizontal" method="post">
                    <div class="form-group">
                        <label for="add_phone" class="col-sm-2 control-label">手机号</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="add_phone" name="phone" placeholder="手机号" value="" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="add_email" class="col-sm-2 control-label">邮箱</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="add_email" name="email" placeholder="邮箱" value="" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="add_name" class="col-sm-2 control-label">姓名</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="add_name" name="name" placeholder="姓名" value="" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="add_name" class="col-sm-2 control-label">初始密码</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="add_password" name="password" placeholder="初始密码" value="123456" />
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default btn-flat" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-success btn-flat add_btn_save">保存</button>
            </div>
        </div>
    </div>
</div>